import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    children: [
        {
          path: '/sys-admin/product/album/insert',
          component: () => import('../views/sys-admin/product/AlbumInsertView.vue')
        },
        {
        path: '/sys-admin/product/album',
        component: () => import('../views/sys-admin/product/AlbumListView.vue')

        },
        {
            path: '/sys-admin/product/category',
            component: () => import('../views/sys-admin/product/CategoryListView.vue')

        },
        {
            path: '/sys-admin/product/category/insert',
            component: () => import('../views/sys-admin/product/CategoryInsertView.vue')

        },
        {
            path: '/sys-admin/product/attributeTemplate/insert',
            component: () => import('../views/sys-admin/product/AttributeTemplateInsertView.vue')

        },
        {
            path: '/sys-admin/product/attributeTemplate',
            component: () => import('../views/sys-admin/product/AttributeTemplateListView.vue')

        },

        {
            path: '/sys-admin/product/brand/insert',
            component: () => import('../views/sys-admin/product/BrandInsertView.vue')
        },
        {
            path: '/sys-admin/product/brand',
            component: () => import('../views/sys-admin/product/BrandListView.vue')

        },
        {
            path: '/sys-admin/product/SPU/insert',
            component: () => import('../views/sys-admin/product/SPUInsertView.vue')

        },
        {
            path: '/sys-admin/product/SPU/insert-2',
            component: () => import('../views/sys-admin/product/SPUInsertView2.vue')

        },
        {
            path: '/sys-admin/product/SPU/insert-3',
            component: () => import('../views/sys-admin/product/SPUInsertView3.vue')

        },

        {
            path: '/sys-admin/permission/admin/insert',
            component: () => import('../views/sys-admin/permission/AdminInsertView.vue')
        },
        {
            path: '/sys-admin/product/admin',
            component: () => import('../views/sys-admin/permission/AdminListView.vue')

        }
    ]
  },
  {
    path: '/about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
